package com.cortex.papaya.utilities;

import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

public class Utilities {
	public static void showKeyboard(boolean isOpen,View view){
		InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
		// what action to perform on keyboard open/hide
		if(isOpen){
			imm.toggleSoftInputFromWindow(view.getApplicationWindowToken(), InputMethodManager.SHOW_FORCED, 0);
		}
		else{
			imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
		}
	}
}
